package com.foreknow.elmboot.mapper;

import com.foreknow.elmboot.po.Cart;
import com.foreknow.elmboot.po.Order;
import com.foreknow.elmboot.po.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
@Mapper
public interface OrderMapper {
    public int CreateOrder(Order order);

    @Select({"select * from orders where orderId=#{orderId}"})
    public Order getOrdersById(Integer orderId);

    public List<Order> listOrderByUserId(String userId);

    @Update({"update orders " +
            "set orderState=1 " +
            "where orderId=#{orderId}"})
    public int updateOrderByOrderId(Integer orderId);
}
